#include "DelegateNode.h"

#include "Output/Console.h"
#include "ScriptCompiler/Token/Token.h"
#include "ScriptCompiler/AST/AccessLevelNode.h"
#include "ScriptCompiler/AST/TypeNode.h"
#include "ScriptCompiler/AST/ParameterNode.h"




void CDelegateNode::DebugPrint(int32_t InDepth)
{
    //print blank spaces for depth
    for(int32_t i=0;i<InDepth;i++)
    {
        WH::Print(U"\t");
    }

    WH::Print(U"delegate ");

    if(AccessLevel.HasValue())
    {
        //print access level
        AccessLevel.GetValue()->DebugPrint(0);

        WH::Print(U" ");
    }


    //print retur type
    ReturnType->DebugPrint(0);

    //print delegate name
    WH::Print(U" ");
    WH::Print(Name->ToString());

    //print parameters
    WH::Print(U"(");
    for(auto& Parameter : Parameters)
    {
        Parameter->DebugPrint(0);
    }

    WH::Print(U");\n");

}